<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>WebWork2</title>
</head>
<body>
<p>To configure PicoContainer to handle the dependency injection of WebWork2 actions, refer to the
web.xml below. For a start there is a slightly different listener to the one defined in the <a href="index.html">main
page</a>. Also, instead of using WebWork2's servlet, use ours. Everything else from the standard WebWork2 setup is
appropriate.</p>
<div class="source"><pre>
	<web-app>
	  <display-name>PicoContainer-Web WebWork 2 Demo</display-name>

	  <context-param>
	    <param-name>webapp-composer-class</param-name>
	    <param-value>*your web app composer class name*</param-value>
	  </context-param>

	  <filter>
	    <filter-name>picoFilter</filter-name>
	    <filter-class>org.picocontainer.web.webwork2.PicoObjectFactory$ServletFilter</filter-class>
	  </filter>

	  <filter-mapping>
	    <filter-name>picoFilter</filter-name>
	    <url-pattern>*.action</url-pattern>
	  </filter-mapping>

	  <listener>
	    <listener-class>org.picocontainer.web.webwork2.WebWork2PicoServletContainerListener</listener-class>
	  </listener>

	  <servlet>
	    <servlet-name>action</servlet-name>
	    <servlet-class>com.opensymphony.webwork.dispatcher.ServletDispatcher</servlet-class>
	  </servlet>

	  <servlet-mapping>
	    <servlet-name>action</servlet-name>
	    <url-pattern>*.action</url-pattern>
	  </servlet-mapping>

	  <welcome-file-list>
	    <welcome-file>index.html</welcome-file>
	  </welcome-file-list>

	  <taglib>
	    <taglib-uri>webwork</taglib-uri>
	    <taglib-location>/WEB-INF/webwork.tld</taglib-location>
	  </taglib>

	</web-app>


</pre></div>
<p>The Maven example project is <a
  href="http://svn.codehaus.org/picocontainer/java/2.x/trunk/web/examples/webwork2-webapp/">here</a>. Make sure you make
and configure your own <a href="composition.html">WebappComposer</a> implementation.</p>
<p>See <a href="downloads.html">downloads</a> on how to download the webwork2 module either using Maven or by
downloading full distribution.</p>
<p>We have a sample application.  It is a small form-style web-app that shows and list of cheeses, allows you to add and delete from the list.  <a href="http://svn.codehaus.org/picocontainer/java/2.x/trunk/web/examples/webwork2-webapp/">See the Maven2 source for it</a>. Here is a screenshot of it running:</p>
<img src="images/WebWork2_App.jpg"/>
<p><a href="http://picocontainer/web/warfiles/pico-webwork2-demo.war">Download the war file for it</a> (full Java source in WEB-INF/classes).</p>

</body>
</html>